<template>
	<view>
		<view class="write_id">
			<input type="text"
			v-model="UID"
			placeholder="请输入ID" placeholder-class="place"/>
		</view>
		<view class="login_btn" @tap="tologin">
			登录
		</view>
	</view>
</template>

<script>
	export default {
		data () {
			return {
				UID: ''
			}
		},
		mounted() {
		},
		onLoad(e) {
			// uni.setStorageSync('team_id', e.id);
			// uni.setStorageSync('team_active_id', e.active_id);
			uni.setStorageSync('team_id','57');
			uni.setStorageSync('team_active_id', '206');
		},
		methods: {
			 getQueryStrings() {
			  var url = location.search; //获取url中"?"符后的字串
			   var theRequest = new Object();
			   if (url.indexOf("?") != -1) {
			      var str = url.substr(1);
			      strs = str.split("&");
			      for(var i = 0; i < strs.length; i ++) {
			         theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);
			      }
			   }
			   return theRequest;
			},
			tologin () {
				this.ajax('login/loginDo', {
					data: {
						uid: this.UID
					},
					success: res => {
						 // console.log (res);
						if(res.code) {
							uni.navigateTo({
								url: '/pageD/team/index'
							})
						}else {
							this.toast(res.msg)
						}
					}
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #FFFFFF;
		overflow: hidden;
	}
</style>
<style lang="less" scoped>
	.write_id {
		width: 600upx;
		height: 80upx;
		border: 2upx solid #e1e1e1;
		margin: auto;
		margin-top: 300upx;
		border-radius: 8upx;
		input {
			width: 100%;
			height: 100%;
			padding-left: 30upx;
		}
	}
	.login_btn {
		width: 600upx;
		height: 80upx;
		border-radius: 8upx;
		text-align: center;
		line-height: 80upx;
		background-color: #8938d3;
		margin: 40upx auto;
		color: #FFFFFF;
		font-size: 32upx;
	}
</style>
